<?php


namespace App\Models;


class AssistWord extends Model
{
    protected $table = 'assist_word';

    // ============= relations ==========
    public function cover()
    {
        return $this->belongsTo(Attachment::class, 'cover');
    }

    public function audio()
    {
        return $this->belongsTo(Attachment::class, 'audio');
    }

    public function lesson()
    {
        return $this->belongsToMany(Lesson::class, 'assist_word_lesson');
    }

    // ============= field ==========
    public function setName($name)
    {
        $this->en_name = $name;
    }

    public function getName()
    {
        return $this->en_name;
    }

    public function setChinese($chinese)
    {
        $this->cn_name = $chinese;
    }

    public function getChinese()
    {
        return $this->cn_name;
    }

    public function setAudio($audio)
    {
        $this->audio = $audio;
    }

    public function getAudio()
    {
        return $this->audio;
    }

    public function setCover($image)
    {
        $this->cover = $image;
    }

    public function getCover()
    {
        return $this->cover;
    }

    public function setPartOfSpeech($partOfSpeech)
    {
        $this->part_of_speech = $partOfSpeech;
    }

    public function getPartOfSpeech()
    {
        return $this->part_of_speech;
    }
}
